import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ApplyLogVO, ApplyLogForm, ApplyLogQuery } from '@/api/boss/applyLog/types';

/**
 * 查询沟通记录列表
 * @param query
 * @returns {*}
 */

export const listApplyLog = (query?: ApplyLogQuery): AxiosPromise<ApplyLogVO[]> => {
  return request({
    url: '/boss/applyLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询沟通记录详细
 * @param applyLogId
 */
export const getApplyLog = (applyLogId: string | number): AxiosPromise<ApplyLogVO> => {
  return request({
    url: '/boss/applyLog/' + applyLogId,
    method: 'get'
  });
};

/**
 * 新增沟通记录
 * @param data
 */
export const addApplyLog = (data: ApplyLogForm) => {
  return request({
    url: '/boss/applyLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改沟通记录
 * @param data
 */
export const updateApplyLog = (data: ApplyLogForm) => {
  return request({
    url: '/boss/applyLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除沟通记录
 * @param applyLogId
 */
export const delApplyLog = (applyLogId: string | number | Array<string | number>) => {
  return request({
    url: '/boss/applyLog/' + applyLogId,
    method: 'delete'
  });
};
